package com.jqr.activity.listviewdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.jqr.activity.listviewdemo.ui.ArrayListActivity;
import com.jqr.activity.listviewdemo.ui.BaseAdapterActivity;
import com.jqr.activity.listviewdemo.ui.SimpleActivity;

public class MainActivity extends AppCompatActivity {

    private Button arrayListAdaperButton;

    private Button simpleAdaperButton;

    private  Button baseAdapterButton;

    private  Intent intent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        arrayListAdaperButton=findViewById(R.id.bntArrayListAdapterListView);


        arrayListAdaperButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent=new Intent(MainActivity.this, ArrayListActivity.class);
                startActivity(intent);

            }
        });

        simpleAdaperButton=findViewById(R.id.bntSimpleAdapterListView);

        simpleAdaperButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent=new Intent(MainActivity.this, SimpleActivity.class);
                startActivity(intent);
            }
        });


        baseAdapterButton=findViewById(R.id.bntBaseAdapterListView);

        baseAdapterButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent=new Intent(MainActivity.this, BaseAdapterActivity.class);
                startActivity(intent);
            }
        });

    }
}